//
//  WSFeedbackRequest.m
//  CharonTVProject
//
//  Created by karong on 2023/8/7.
//

#import "WSFeedbackRequest.h"
#import "WSFeedbackType.h"

@implementation WSFeedbackRequest

+ (void)loadcharonTV_FeedbackTypeWithSuccess:(charonTV_ArrayBlock)success failed:(Failure)failed {
    NSString * url = API_CHARONTV_FEEDBACK_TYPE;
    NSDictionary * parameters = @{};
    [self postWithURLString:url parameters:parameters success:^(NSDictionary * _Nonnull responseDict) {
        NSArray * array = [WSFeedbackType mj_objectArrayWithKeyValuesArray:responseDict[@"items"]];
            success(array);
    } failure:failed];
}

+ (void)submitcharonTV_FeedbackWithOpinion:(NSString *)opinion type:(NSInteger)type images:(NSString *)images success:(charonTV_EmptyBlock)success failed:(Failure)failed {
    NSString * url = API_CHARONTV_FEEDBACK_SUBMIT;
    NSDictionary * parameters = @{@"opinion":WSEmptyStr(opinion),
                                  @"type":@(type),
                                  @"images":WSEmptyStr(images),
                                  @"user_id":@(appUserCenter.id)
    };
    [self postWithURLString:url parameters:parameters success:^(NSDictionary * _Nonnull responseDict) {
        success();
    } failure:failed];
}

@end
